import './mask.css'
import React from 'react';
// import { useState } from 'react'

// export default function Mask () {
//   const [show, setShow] = useState(true)
//   return (<div className='mask' style={{ display: show ? '' : 'none' }}>
//     <button className='close-btn' onClick={() => {
//       setShow(!show)
//     }}>点我关闭弹窗</button>
//   </div>);
// }

export default class Mask extends React.Component {
  state = {
    show: true
  }

  render () {
    const { show } = this.state
    return (<div className='mask' style={{ display: show ? '' : 'none' }}>
      <button className='close-btn' onClick={() => {
        this.setState(preState => ({ show: !preState.show }))
      }}>点我关闭弹窗</button>
    </div>);
  }

}

